from com.power.auto.test.config.EnvManager import *
from com.power.auto.test.hessian.hessianInvokerClient import instance


class Job(object):

    def __init__(self, url, class_name, invoke_methond, param_class, params_json):
        self.url = url
        self.class_name = class_name
        self.invoke_methode = invoke_methond
        self.param_class = param_class
        self.param_json = params_json

    def invok(self):
        print(id(instance))
        return instance.invoke_hessian(self.url, self.class_name, self.invoke_methode, self.param_class,
                                                  self.param_json)


if __name__ == '__main__':
    hasattr = Job('http://127.0.0.1:8080/power-hessian/hessian/PayFacade',
                                    'com.yeepay.power.facade.order.PayFacade',
                                    'createOrderToken', 'com.yeepay.power.dto.order.CreateOrderTokenRequestDTO',
                                    '{\"orderSourceTypeEnums\":\"PC\"}')
    joblist=[]
    joblist.append(hasattr)
    result = joblist[0].invok()

